// add by zhujun 2005-08-20 : for jscelendar
// adapter from jscelender to old date format
function setupJscelendar(inputFieldId,calendarTrigger){
    Calendar.setup({
        inputField     :    inputFieldId,      // id of the input field
        ifFormat       :    "%Y-%m-%d %H:%M:00",       // format of the input field
        showsTime      :    true,            // will display a time selector
        timeFormat     :    "24",
        button         :    calendarTrigger,   // trigger for the calendar (button ID)
        singleClick    :    true,           // single-click mode
        step           :    1                // show all years in drop-down boxes (instead of every other year as default)
    });
}

function setupJscelendar2(inputFieldId,calendarTrigger){
	Calendar.setup({
        inputField     :    inputFieldId,      // id of the input field
        ifFormat       :    "%Y-%m-%d",       // format of the input field
        showsTime      :    false,            // will display a time selector
        timeFormat     :    "24",
        button         :    calendarTrigger,   // trigger for the calendar (button ID)
        singleClick    :    true,           // single-click mode
        step           :    1                // show all years in drop-down boxes (instead of every other year as default)
    });
}

function adapterForOldDate(){
	document.forms[0].year1.value = getYear(document.forms[0].fromCal.value);
	document.forms[0].month1.value = getMonth(document.forms[0].fromCal.value);
	document.forms[0].day1.value = getDay(document.forms[0].fromCal.value);
	document.forms[0].hour1.value = getHoure(document.forms[0].fromCal.value);
	document.forms[0].minute1.value = getMinute(document.forms[0].fromCal.value);
	
	document.forms[0].year2.value = getYear(document.forms[0].toCal.value);
	document.forms[0].month2.value = getMonth(document.forms[0].toCal.value);
	document.forms[0].day2.value = getDay(document.forms[0].toCal.value);
	document.forms[0].hour2.value = getHoure(document.forms[0].toCal.value);
	document.forms[0].minute2.value = getMinute(document.forms[0].toCal.value);
}

function getYear(dateStr){
  return dateStr.substr(0,4);
}
function getMonth(dateStr){
  return dateStr.substr(5,2);
}
function getDay(dateStr){
  return dateStr.substr(8,2);
}
function getHoure(dateStr){
  return dateStr.substr(11,2);
}
function getMinute(dateStr){
  return dateStr.substr(14,2);
}
// ---------- end update ----------//
